/*******************************************************************************
* Project: QSAR(Cute Software Architecture) 
*
* Copyright: Copyright(C) 2024 by YuetingBen, All Rights Reserved
*
* File name: Nvm.h
*
* Brief: ;
*
* Author: Yueting.Ben
*
* Module: Nvm
*
* Revision:
* ------------------------------------------------------------------------------
* V:0.0.1: 
* --Yueting.Ben, 2024-06-18 
* --Initial release

********************************************************************************/

#ifndef NVM_H
#define NVM_H

/** HEADER FILES **/
#include "NvmCfg.h"


/** MACRO DEFINITION **/
#define NVM_MODULE_ID  0u

#define NVM_SW_MAJOR_VERSION   0u   /* Major version */
#define NVM_SW_MINOR_VERSION   0u   /* Minor version */
#define NVM_SW_PATCH_VERSION   1u   /* Patch level version */


/** TYPEDEF DEFINITION **/
typedef uint8 NvM_JobIdType;
#define NVM_JOB_ID_READ_BLOCK ((NvM_JobIdType)0u)
#define NVM_JOB_ID_WRITE_BLOCK ((NvM_JobIdType)1u)
#define NVM_JOB_ID_MAX ((NvM_JobIdType)2u)

typedef uint8 NvM_QueueIndexType;

typedef struct
{
    NvM_BlockIdType BlockId;
    NvM_JobIdType JobId;
    NvMRamBlockDataAddressType RamAddress;
    uint8 QueueEmpty;
    NvM_QueueIndexType NextEntry;
    NvM_QueueIndexType PrevEntry;
}NvM_QueueType;


typedef struct
{
    NvM_RequestResultType RequestStatus;
    
}NvM_BlockManagementType;

/** LOCAL DATA DECLARATION **/
extern NvM_QueueType* CurrentQueue;


/** LOCAL FUNCTION DECLARATION **/
extern NvM_BlockManagementType NvmAdministrativeBlock[NvmConf_Block_Max];



#endif

